
//
//  DFLiveView.m
//  DFMessage
//
//  Created by lanou on 15/10/27.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "DFLiveView.h"
#import "Header.pch"
#import "UIImageView+WebCache.h"
#import "DFSignlTon.h"

@implementation DFLiveView

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        _imgsrc2Image = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, kScreenWidth-10, 120)];
        [self.contentView addSubview:_imgsrc2Image];
        
        _stitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 125, kScreenWidth - 10, 30)];
        _stitleLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_stitleLabel];
        
        _sdateLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 158, 130, 15)];
        _sdateLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_sdateLabel];
        
        _live_numLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 80, 158, 90, 15)];
        _live_numLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_live_numLabel];
        
        UILabel *alabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 30, 158, 25, 15)];
        alabel.text = @"参与";
        alabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:alabel];
        
//        UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0, 175, kScreenWidth, 2)];
//        line.backgroundColor = [UIColor lightGrayColor];
//        [self.contentView addSubview:line];
    }
    
    
    return self;
}


-(void)setConfigureModel:(LiveModel *)configureModel{
    _configureModel = configureModel;
    
    DFSignlTon *signlTon = [DFSignlTon shareInstance];
    if (signlTon.savemode == SaveModeYes)
    {
        _imgsrc2Image.image = [UIImage imageNamed:@""];
    }else
    {
        [_imgsrc2Image sd_setImageWithURL:[NSURL URLWithString:configureModel.imgSrc2]];
    }

    _stitleLabel.text = configureModel.stitle;
    _sdateLabel.text = configureModel.sdate;
    _live_numLabel.text = [NSString stringWithFormat:@"%@",configureModel.live_num];
  
    
}

@end
